<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    #fu{
      width: 500px;
      height: 500px;
      margin: 50px auto;
      background: darkorange;
      /* 方案一 */
      /* position: relative; */

      /* 方案2 */
      display: flex;
      justify-content: center;
      align-items: center;
    }
    #zi{
      width: 200px;
      height: 200px;
      background: darkblue;
      /* 方案一 */
      /* position: absolute;
      left: 0;
      bottom: 0;
      right: 0;
      top:0;
      margin: auto; */

    }
  </style>
</head>
<body>
      <div id="fu">
        <div id="zi"></div>
      </div>
    
</body>
</html>